package com.shao.demo.feignconsumer.rpc;

import com.shao.demo.feignconsumer.rpc.fallback.HelloServiceFallback;
import com.shao.demo.feignconsumer.common.wapper.ResponseEntityWrapper;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author zhiqi.shao
 * @Date 2018/5/23 16:16
 */
@FeignClient(value = "client-demo1" ,fallback = HelloServiceFallback.class)
public interface HelloService {


    /**
     * 注意如果写了@RequestParam那么@RequestParam(name = "name")里面的name="name"是必填项，否则服务起不来
     * 传参方式：@RequestParam @RequestBody  @RequestHeader
     * @param name
     * @return
     */
    @GetMapping(value = "/hello")
    ResponseEntityWrapper sayHello(@RequestParam(name = "name") String name);
}
